<?php
$this->pageTitle = Yii::app()->name;
$this->breadcrumbs=array(
	'管理',
);
include_once('menu.php');
?>
<script>
function done(fid){
	$.post('<?php echo CHtml::normalizeUrl(array('/admin/done'));?>',{'fid':fid}, function (data) {
        var ret = $.parseJSON(data);
        if (ret != null && ret.success != null && ret.success) {
			alert(ret.msg);
			location.reload(true);
        }
	});
}
</script>
<div style="width:100%; float:left; margin-bottom:10px; text-align:right;">
	<form action="" name="jobForm" id="jobForm" method="get">
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<tr>
			<td width="15%" class="td_right">Pricing 日期: </td>
			<td width="35%"><input type="text" name="Date" id="Date" value="<?= $search['Date'] ?>" readonly="readonly" style="width:95px;" />
		<img onclick="displayCalendar(document.jobForm.Date,'yyyymmdd',this)" style="cursor:pointer;" width="25" src="images/calendar.png" /></td>
			<td width="15%" class="td_right">产品编号: </td>
			<td><input type="text" name="ProductModel" value="<?php if(isset($search['ProductModel']))echo $search['ProductModel'];?>" id="Color" class="input_size4" /></td>
		</tr>
		<tr>
			<td class="td_right">产品细节: </td>
			<td><input type="text" name="ProductDetail" value="<?php if(isset($search['ProductDetail']))echo $search['ProductDetail'];?>" id="ProductDetail" class="input_size4" /></td>
			<td class="td_right">采购人: </td>
			<td><input type="text" name="Buyer" value="<?php if(isset($search['Buyer']))echo $search['Buyer'];?>" class="input_size4" /></td>
		</tr>
		<tr>
			<td class="td_right">收件部门1: </td>
			<td><input type="text" name="Destination1" value="<?php if(isset($search['Destination1']))echo $search['Destination1'];?>" id="Destination1" class="input_size4" /></td>
			<td class="td_right">收据编号: </td>
			<td><input type="text" name="ReceiptNo" value="<?php if(isset($search['ReceiptNo']))echo $search['ReceiptNo'];?>" class="input_size4" /></td>
		</tr>
		<tr>
			<td class="td_right">操作时间: </td>
			<td colspan="2">
				<input type="text" name="s" id="s" value="<?= $search['s'] ?>" readonly="readonly" style="width:100px;" />
				<img onclick="displayCalendar(document.jobForm.s,'yyyy-mm-dd',this)" style="cursor:pointer;" src="images/calendar.png" /> - 
				<input type="text" name="e" id="e" value="<?= $search['e'] ?>" readonly="readonly" style="width:100px;" />
				<img onclick="displayCalendar(document.jobForm.e,'yyyy-mm-dd',this)" style="cursor:pointer;" src="images/calendar.png" />
			</td>
			<td style="text-align:right;">
				<a style="margin-right:50px;" href="<?=Yii::app()->createUrl('admin/feedback')?>"><img src="images/shua.png" border="0" /></a>
				<input type="image" src="images/go.png" name="jobSub" id="jobSub" value="Go" />
			</td>
		</tr>
	</table>				
		<input type="hidden" name="r" value="admin/feedback" />
	</form>
</div>
<table cellspacing="0" cellpadding="0" width="100%" class="tbl" style="float:left;">
	<tr class="head">
		<td width="8%">日期</td>
		<td width="10%">产品编号</td>
		<td width="30%">产品细节</td>
		<td width="40%">验货反馈</td>
		<td width="6%">处理</td>
		<td>详情</td>
	</tr>
	<?php
    $i = 0;
    $cssArr = array(0 => 'even', 1 => 'odd', 2 => 'three');
    foreach ($rowTable as $item) {
        $trClass = $cssArr[$i % 3];
        $i++;
        ?>
	<tr class="<?= $trClass ?>">
		<td>
			<?=$item->pricing->Date?>
		</td>
		<td>
			<?=$item->pricing->ProductModel?>
		</td>
		<td>
			<?=$item->pricing->ProductDetail?>
		</td>
		<td>
			<?=$item->content?>
		</td>
		<td style="text-align:center;">
			<a onclick="done(<?=$item->fid?>)" href="###">处理</a>
		</td>
		<td style="text-align:center;">
			<a target="_blank" href="<?=Yii::app()->createUrl('psi/update',array('id'=>$item->pricingid))?>">详情</a>
		</td>
	</tr>
	<?php
    }
    ?>
</table>
<div id="pager" align="center">
<?php  
	$this->widget('CLinkPager',array(  
		'header'=>'',  
		'firstPageLabel' => '<<',
		'lastPageLabel' => '>>',
		'prevPageLabel' => '<',
		'nextPageLabel' => '>',
		'pages' => $pages,  
		'maxButtonCount'=>13  
		));  
?>
</div>